home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-04
/
422mods.zip
/
TW08.422
< prev
next >
Wrap
Text File
|
1993-03-20
|
8KB
|
316 lines
TW08.MOD -- Extended automessage mod for 4.xx? 4.22 at least
The Warlord #1 @17306
Sat Mar 13 19:55:54 1993
5To7: 1Everyone
┌────────────────────────────────────────────────────────────────────────────┐
│ Mod Name: TW08.MOD Mod Author: The Warlord │
│ Difficulty: ▒░░░░░░░░░ Date: 03/13/93 │
│ WWIV Version: 4.22 (others, too) │
│ Files Affected: MISCCMD.C, FCNS.H │
│ Description: This is an extended auto-message mod, see features below. │
└────────────────────────────────────────────────────────────────────────────┘
─ Features ─
■ 10 lines, instead of only 3
■ 70 characters per line, instead of only 39
■ Pretty colors all over :)
■ You can use colors in the automessage
■ Sysop or automessage author can delete the automessage
■ /S ends automessage, if it's not 10 lines long.
■ /ABT aborts the automessage
[ Step 1 ]: Back up your source! This is always a good idea.. There could be
a little cockroach or two in this mod somewhere. :)
Example backup command line:
pkzip -ex -u source.zip *.c *.h *.mak
[ Step 2 ]: Load up MISCCMD.C, and delete the functions:
void read_automessage()
void write_automessage1()
void write_automessage()
Block copy the following 3 functions in their place:
void read_automessage()
{
int i,i1,i2,i3,f,len,ptrbeg[10],ptrend[10],temp;
char s[81],l[11][81],anon,buf[512];
slrec ss;
temp=curatr;
sprintf(s,"%sAUTO.MSG",syscfg.gfilesdir);
f=open(s,O_RDWR | O_BINARY);
nl();
anon=status.amsganon;
if (f<1) {
nl();
title("No Auto-Message!");
nl();
} else {
len=read(f,(void *)buf,512);
close(f);
for (i=0; i<10; i++) {
ptrbeg[i]=0;
ptrend[i]=0;
}
i=0;
i1=0;
i2=0;
for(i=0; i<len; i++) {
if (i1) {
if (buf[i]==10) {
ptrbeg[i2]=i+1;
i1=0;
}
} else {
if (buf[i]==13) {
ptrend[i2]=i-1;
if (i2<11) {
for (i3=ptrbeg[i2]; i3<=ptrend[i2]; i3++)
l[i2][i3-ptrbeg[i2]]=buf[i3];
l[i2][ptrend[i2]-ptrbeg[i2]+1]=0;
}
++i2;
i1=1;
}
}
}
ss=syscfg.sl[actsl];
if (anon)
if (ss.ability & ability_read_post_anony)
sprintf(s,"7───══ 5%s 7══───",&(l[0][0]));
else
strcpy(s,"7───══ 5UNKNOWN 7══───");
else
strcpy(s,&(l[0][0]));
nl();
if (okansi()) {
npr("\x1b[1;37;40m▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄\r\n\x1b[47m \x1b[0;34;47mAutomessage By 7 %s\x1b[40m\r\n",s);
npr("\x1b[47m\x1b[1;30;40m▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀\r\n0");
}
else
npr("Automessage By: %s\r\n", s);
nl();
i=1;
while ((ptrend[i]) && (i<11)) {
pl(&(l[i][0]));
++i;
}
nl();
}
curatr=temp;
}
void write_automessage1()
{
int i,i1,i2=0,f;
char s[81],l[11][81],g[81];
slrec ss;
nl();
npr("5Enter auto-message now, max 710 5lines.\r\n");
npr("5Enter 2/S 5on a blank line to end.\r\n");
nl();
s[0]=0;
for (i=0; i<10; i++) {
npr("7[5%2d7] ",i+1);
sb(70,7);
inli(&(l[i][0]),s,70,1);
if (stricmp(&(l[i][0]),"/s")==0) {
l[i][0]=0;
i2=i;
break;
}
sprintf(g,"1");
strcat(g,&(l[i][0]));
strcat(g,"\r\n");
strcpy(&(l[i][0]),g);
}
if (!i2)
i2=10;
nl();
ss=syscfg.sl[actsl];
if (ss.ability & ability_post_anony) {
prt(5,"Anonymous? ");
if (yn())
i1=anony_sender;
else
i1=0;
}
i1=0;
prt(5,"Is this OK? ");
if (yn()) {
status.amsganon=i1;
status.amsguser=usernum;
save_status();
sprintf(s,"%sAUTO.MSG",syscfg.gfilesdir);
f=open(s,O_RDWR | O_BINARY | O_CREAT | O_TRUNC, S_IREAD | S_IWRITE);
strcpy(s,nam(&thisuser,usernum));
strcat(s,"\r\n");
write(f,(void *)s,strlen(s));
for (i=0; i<i2; i++)
write(f,(void *)&(l[i][0]),strlen(&(l[i][0])));
sysoplog("5Changed Auto-Message.");
nl();
pl("7Auto-message saved.");
nl();
close(f);
}
}
void write_automessage()
{
char ch, s[81];
int done,okwrite;
slrec ss;
ss=syscfg.sl[actsl];
if (ss.posts)
okwrite=1;
else
okwrite=0;
if (thisuser.restrict & restrict_automessage)
okwrite=0;
done=0;
do {
cls();
pl("7Auto-Message:");
nl();
pl("7[2R7] 1Read auto-message");
pl("7[2W7] 1Write auto-message");
pl("7[2A7] 1Auto-reply to auto-message");
if (so()) {
pl("7[2D7] 1Delete auto-message");
pl("7[2Q7] 1Quit");
nl();
npr("5Choice: ");
sb(1,7);
ch=onek("QDRAW");
}
else {
pl("7[2Q7] 1Quit");
nl();
npr("5Choice: ");
sb(1,7);
ch=onek("QRAW");
}
switch(ch) {
case 'Q':
done=1;
break;
case 'R':
read_automessage();
pausescr();
break;
case 'W':
if (!okwrite)
npr("6Sorry, you can't change the automessage.\r\n");
else
write_automessage1();
pausescr();
break;
case 'D':
sprintf(s,"%sAUTO.MSG",syscfg.gfilesdir);
if (exist(s)) {
cls();
read_automessage();
nl();
npr("5Delete auto-message? ");
if (yn()) {
status.amsguser=0;
status.amsganon=0;
unlink(s);
pl("6Deleted!");
sysoplog(" 2Deleted the auto-message.");
}
}
else
pl("6There's no auto-message to delete!");
pausescr();
break;
case 'A':
if (status.amsguser)
email(status.amsguser,0,0,status.amsganon);
break;
}
} while ((!done) && (!hangup));
}
[ Step 3 ]: Now page go down to the bottom of the file (MISCCMD.C), and
block copy these functions in.. Note: make sure you don't
already have these functions.. search through FCNS.H for them.
If you already have them, replace them with these.
void sb(int num, int colornum)
{
int i;
prt(colornum,"[");
ansic(1);
for (i=0;i<num;i++)
outchr(' ');
ansic(colornum);
outchr(']');
if (okansi())
npr("\x1b[%dD",num+1);
else
for (i=0;i<num+1;i++)
outchr('\b');
ansic(1);
}
void cls()
{
if (okansi())
outstr("\x1b[2J");
else
outchr(12);
}
void ansititle(char *str)
{
int i,length,temp;
if (okansi()) {
temp=curatr;
length=strlen(str);
length+=2;
for (i=0;i<length;i++)
npr("\x1b[1;37;40m▄");
nl();
npr("\x1b[0;31;47m %s ",str);
nl();
for (i=0;i<length;i++)
npr("\x1b[1;30;40m▀");
nl();
curatr=temp;
}
else
npr("%s",str);
}
[ Step 4 ]: Save MISCCMD.C, and load up FCNS.H.. Go down to MISCCMD.C, at
the end, and copy these lines in:
(note: if you can MAKE FCNS do that instead..).
void sb(int num, int colornum);
void cls();
void ansititle(char *str);
[ Step 6 ]: Save FCNS.H, and start it compiling.. It won't take TOO long on a
286/386/486, 'cause it only needs to compile 1 file.. but if you
have an 8088 or something, go buy a new computer while it's
compiling. =|-]
If you like, and install this mod, or any of my mods, or if you feel the need
to contact me for any reason, either call my board..
The Fish Tank (703) 256-4117
or E-Mail me at:
WWIVLink 1@17306
WWIVNet 1@7309
IceNet 1@7309
FishNet 193@5002